package com.weifly.weistock.core.event;

/**
 * 股票事件枚举
 *
 * @author weifly
 * @since 2019/8/8
 */
public enum StockEventEnum {
    UPDATE_ACCOUNT("updateAccount", "更新账号"),
    UPDATE_STOCK_BY_USER("updateStockByUser", "人工更新股票配置"),
    UPDATE_STOCK_BY_TASK("updateStockByTask", "任务自动更新股票配置");

    private String event; // 事件
    private String name; // 名称

    private StockEventEnum(String event, String name){
        this.event = event;
        this.name = name;
    }

    public String getEvent() {
        return event;
    }

    public String getName() {
        return name;
    }

    public static StockEventEnum findStockEvent(String event){
        for(StockEventEnum eventEnum : values()){
            if(eventEnum.getEvent().equals(event)){
                return eventEnum;
            }
        }
        return null;
    }
}
